package com.zzq.my.jetpacks.jectpackapp.ui.fragment

import android.os.Bundle
import android.view.View
import androidx.core.view.accessibility.AccessibilityViewCommand
import by.kirich1409.viewbindingdelegate.viewBinding
import com.aisier.architecture.base.BaseFragment
import com.zzq.my.jetpacks.jectpackapp.R
import com.zzq.my.jetpacks.jectpackapp.databinding.FragmentTextBinding

/**
 * 描述：class describe
 * 作者：zhuangzeqin
 * 时间: 2021/12/27-11:19
 * 邮箱：zzq@eeepay.cn
 * 备注:
 */

open class TextFragment : BaseFragment(R.layout.fragment_text) {
    val bindView by viewBinding(FragmentTextBinding::bind)
    companion object {
        const val ARG_STR = "text"
        fun newInstance(text: String) = TextFragment().apply {
            //传递参数
            arguments = Bundle().apply {
                putString(ARG_STR, text)
            }
        }
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        arguments?.takeIf { it.containsKey(ARG_STR) }?.apply {
            val text = getString(ARG_STR)
            bindView.tvText.text = text

        }
    }

    override fun lazyInit() {

    }
}